IDL_Object
The IDL_Object class is designed to be inherited by objects that define _overload
methods, in order to overload the behavior of one or more of IDL’s standard operators. It is not meant to be instantiated directly.
To overload the behavior of a standard operator for objects of a user-defined object class, you would write an overloaded operator method for the class, and add IDL_Object as a superclass of the class. Object classes that do not inherit from the IDL_Object class do not use operator overload methods even if the methods are defined.
Object classes that inherit from the IDL_Object class can also overload several routines that provide information about variables: HELP, PRINT, and SIZE.
Note: The INIT and CLEANUP methods for a subclass do not need to call this superclass' INIT and CLEANUP methods.
Superclasses
None
Creation
This class serves as an interface class for other classes. There is never a need to instantiate an IDL_Object class directly.
Properties
The following properties are used to return the variable attributes for the object. You can subclass the GetProperty method and return different values for these properties.
DIM
By default, calls the ::_overloadSize method and returns an array containing the dimensions.
LENGTH
By default, calls the ::_overloadSize method and returns an integer giving the number of elements.
NDIM
By default, calls the ::_overloadSize method and returns an integer giving the number of dimensions.
TNAME
By default, returns "OBJREF".
TYPECODE
By default, returns 11 (the type code for objects).
TYPENAME
By default, returns the class name for the object.
TYPESIZE
By default, returns 4 (the number of bytes for an object reference).
Methods
This class defines methods for each standard IDL operator that can be overloaded.
This class has the following methods:
- IDL_Object::GetProperty
- IDL_Object::_overloadAND
- IDL_Object::_overloadAsterisk
- IDL_Object::_overloadBracketsLeftSide
- IDL_Object::_overloadBracketsRightSide
- IDL_Object::_overloadCaret
- IDL_Object::_overloadEQ
- IDL_Object::_overloadForeach
- IDL_Object::_overloadFunction
- IDL_Object::_overloadGE
- IDL_Object::_overloadGreaterThan
- IDL_Object::_overloadGT
- IDL_Object::_overloadHelp
- IDL_Object::_overloadImpliedPrint
- IDL_Object::_overloadIsTrue
- IDL_Object::_overloadLE
- IDL_Object::_overloadLessThan
- IDL_Object::_overloadLT
- IDL_Object::_overloadMethod
- IDL_Object::_overloadMinus
- IDL_Object::_overloadMinusMinus
- IDL_Object::_overloadMinusUnary
- IDL_Object::_overloadMOD
- IDL_Object::_overloadNE
- IDL_Object::_overloadNOT
- IDL_Object::_overloadOR
- IDL_Object::_overloadPlus
- IDL_Object::_overloadPlusPlus
- IDL_Object::_overloadPostIncrementCopy
- IDL_Object::_overloadPound
- IDL_Object::_overloadPoundPound
- IDL_Object::_overloadPrint
- IDL_Object::_overloadSize
- IDL_Object::_overloadSlash
- IDL_Object::_overloadTilde
- IDL_Object::_overloadXOR
Example
A user-defined class that overloads one or more operators must include the INHERITS token in the class structure definition:
PRO myObjectClass__define
structure = { myObjectClass, $
PROPERTY1: 0L, $
PROPERTY2: '', $
INHERITS IDL_Object $
}
END
Version History
8.0 |
Introduced |
8.3 | Added ::_overloadImpliedPrint |
8.4 |
Added ::GetProperty method with Variable Attributes |
8.4.1 |
Added ::_overloadPlusPlus, ::_overloadMinusMinus, ::_overloadPostIncrementCopy |
8.5 | Added ::_overloadFunction and ::_overloadMethod |